class MessageChatRecord {
  String sendId;
  String acceptId;
  String username;
  String avatar;
  int? count;
  String content;
  String date;
  String time;

  MessageChatRecord({
    required this.sendId,
    required this.acceptId,
    required this.username,
    required this.avatar,
    this.count,
    required this.content,
    required this.date,
    required this.time,
  });

  factory MessageChatRecord.fromJson(Map<String, dynamic> json) {
    return MessageChatRecord(
      sendId: json['sendId'],
      acceptId: json['acceptId'],
      username: json['username'],
      avatar: json['avatar'],
      count: json['count'],
      content: json['content'],
      date: json['date'],
      time: json['time'],
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'sendId': sendId,
      'acceptId': acceptId,
      'username': username,
      'avatar': avatar,
      'count': count,
      'content': content,
      'date': date,
      'time': time,
    };
  }
}

class MessageRecordChatList {
  List<MessageChatRecord> records;
  int total;

  MessageRecordChatList({required this.records,required this.total});
  factory MessageRecordChatList.fromJson(List<dynamic> jsonList, int total) {
    List<MessageChatRecord> records = [];
    for (var item in jsonList) {
      records.add(MessageChatRecord.fromJson(item));
    }
    return MessageRecordChatList(records: records,total: total);
  }

  List<Map<String, dynamic>> toJson() {
    return records.map((record) => record.toJson()).toList();
  }
}